/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.smg.community.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;


import javacommon.base.*;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class SmgIndexRightbottomImage extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "SmgIndexRightbottomImage";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_IMAGEPATH = "imagepath";
	public static final String ALIAS_IMAGETITLE = "imagetitle";
	public static final String ALIAS_ISSHOWIMAGETITLE = "isshowimagetitle";
	public static final String ALIAS_STATE = "state";
	public static final String ALIAS_SHOWORDER = "showorder";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * id       db_column: id 
     */	
	private java.lang.Integer id;
    /**
     * imagepath       db_column: imagepath 
     * 图片完整路径
     * 例如 :http://h.hiphotos.baidu.com/album/pic/item/7c1ed21b0ef41bd5a2e618fa50da81cb39db3d02.jpg?psign=a2e618fa50da81cb39dbb6fd5266d0160824ab18972b193a
     */	
	private java.lang.String imagepath;
    /**
     * imagetitle       db_column: imagetitle 
     * 图片的title
     */	
	private java.lang.String imagetitle;
    /**
     * isshowimagetitle       db_column: isshowimagetitle 
     * 是否显示图片title
     */	
	private java.lang.Integer isshowimagetitle;
    /**
     * state       db_column: state 
     * 状态
     * 1-在线
     * 0-预览
     */	
	private java.lang.Integer state;
    /**
     * showorder       db_column: showorder 
     * 显示顺序
     */	
	private java.lang.Integer showorder;
	//columns END
	
	private String link;
	
	private int cityNo;
	
	private String cityName;
	public SmgIndexRightbottomImage(){
	}


	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setImagepath(java.lang.String value) {
		this.imagepath = value;
	}
	
	public java.lang.String getImagepath() {
		return this.imagepath;
	}
	public void setImagetitle(java.lang.String value) {
		this.imagetitle = value;
	}
	
	public java.lang.String getImagetitle() {
		return this.imagetitle;
	}
	public void setIsshowimagetitle(java.lang.Integer value) {
		this.isshowimagetitle = value;
	}
	
	public java.lang.Integer getIsshowimagetitle() {
		return this.isshowimagetitle;
	}
	public void setState(java.lang.Integer value) {
		this.state = value;
	}
	
	public java.lang.Integer getState() {
		return this.state;
	}
	public void setShoworder(java.lang.Integer value) {
		this.showorder = value;
	}
	
	public java.lang.Integer getShoworder() {
		return this.showorder;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Imagepath",getImagepath())
			.append("Imagetitle",getImagetitle())
			.append("Isshowimagetitle",getIsshowimagetitle())
			.append("State",getState())
			.append("Showorder",getShoworder())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SmgIndexRightbottomImage == false) return false;
		if(this == obj) return true;
		SmgIndexRightbottomImage other = (SmgIndexRightbottomImage)obj;
		return new EqualsBuilder()
			.isEquals();
	}


	public String getLink() {
		if (  link!=null && link.indexOf("http://") == -1){
			link =  "http://" + link ;
		}
		return link;
	}


	public void setLink(String link) {
		this.link = link;
	}


	public String getCityName() {
		return cityName;
	}


	public void setCityName(String cityName) {
		this.cityName = cityName;
	}


	public int getCityNo() {
		return cityNo;
	}


	public void setCityNo(int cityNo) {
		this.cityNo = cityNo;
	}
}

